import React, { useEffect, useRef } from 'react'
import * as echarts from 'echarts/core';

function MyChart({option}) {
    const box=useRef(null)
    useEffect(()=>{
        const myChart = echarts.init(document.getElementById('main'));
        myChart.setOption(option)
    },[])
    
  return (
    <div>
        <div ref={box} style={{width:'100%',height:'100%'}}></div>
    </div>
  )
}

export default MyChart
